﻿@{
    Layout = null;
    List<LeEdu.MODEL.Student> lst = ViewBag.ss;
}

<!DOCTYPE html>

<html>
<!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")
<body>
    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")
    <div class="container">
        <div class="row">

            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/CouseCreateManage_Menu_Left.cshtml")

            <!--课程图片-->
            <div class="col-md-9">

                <div class="panel panel-default panel-col">
                    <div class="panel-heading">
                        学员管理
                        <a class="btn btn-info btn-sm pull-right mhs" href="/course/157/manage/student/export"><i class="glyphicon glyphicon-export"></i> 导出学员</a>
                        <a class="btn btn-info pull-right btn-sm mhs" href="/course/157/manage/student/import"><i class="glyphicon glyphicon-import"></i> 批量导入</a>
                        <button class="btn btn-info btn-sm pull-right mhs" id="student-add-btn" data-toggle="modal" data-target="#modal" data-url="/course/157/manage/student/create"><i class="glyphicon glyphicon-plus"></i> 添加学员</button>
                    </div>

                    <div class="panel-body">
                        <form class="form-inline well well-sm " action="" method="get" novalidate="">
                            <div class="form-group">
                                <input class="form-control " placeholder="请输入用户名" name="nickname" value="" type="text">

                                <button class="btn btn-primary">搜索</button>
                            </div>
                            <div class="clearfix"></div>
                        </form>
                        <table class="table table-striped" id="course-student-list">
                            <thead>
                                <tr>
                                    <th width="40%">学员</th>
                                    <th width="30%">学习进度</th>
                                    <th width="30%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in lst)
                                {
                                    <tr id="student-32-tr">
                                        <td class="media" style="vertical-align: middle;">
                                            <a class="pull-left js-user-card" href="/user/32" data-card-url="/user/32/card/show" data-user-id="32">
                                                @{
                                    var ddd = item.UserInfo.Avatar;
                                    if (ddd == null)
                                    {
                                        <img class="avatar-sm" src="~/Content/img/default-head-image.png" />
                                    }
                                    else
                                    {
                                        <img class="avatar-sm" src="~/Img/@ddd" />
                                    }
                                                }
                                            </a>
                                                                                  <span hidden="hidden">@Session["idd"]=@item.StudentId</span>
                                            <a target="_blank" href="/user/32">@item.UserInfo.XingMing</a>
                                            <div class="text-muted text-sm">加入时间：@item.StudentDateTime</div>
                                        </td>

                                        <td style="vertical-align: middle;">
                                            <div class="progress mvm" title="已学0课时">
                                                <div class="progress-bar" style="width: 0%">
                                                </div>
                                            </div>
                                        </td>

                                        <td style="vertical-align: middle;">
                                            <div class="btn-group">
                                                <button class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal1" data-url="/message/create/32">发私信</button>
                                                <button class="btn btn-default btn-sm" data-toggle="modal" data-target="#modal2" >查看资料</button>
                                                <a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                                    管理
                                                    <span class="caret"></span>
                                                </a>
                                                <ul class="dropdown-menu pull-right">
                                                    <li><a class="" href="" data-toggle="modal" data-target="#modal" data-url="/course/157/manage/student/32/remark">备注</a></li>
                                                    <li>
                                                        <a class="follow-student-btn" href="javascript:;" data-url="/user/32/follow">关注</a>
                                                        <a class="unfollow-student-btn" href="javascript:;" data-url="/user/32/unfollow" style="display:none;">已关注</a>
                                                    </li>
                                                    <li><a class="" href="" data-toggle="modal" data-target="#modal" data-url="/course/157/set_expiryday/32">增加有效期</a></li>

                                                    <li><a class="student-remove" href="javascript:;" data-url="/course/157/manage/student/32/remove" data-user="学员">移除</a></li>
                                                </ul>
                                            </div>
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>

                        @*分页*@
                        <div>
                            <a href="/Course/CourseStudents?PageIndex=1" class="btn btn-primary btn-lg active">首页</a>

                            <a href="/Course/CourseStudents?PageIndex=@Convert.ToInt32((ViewBag.PageIndex - 1) < 1 ? (1) : (ViewBag.PageIndex - 1))" class="btn btn-default">上一页</a>

                            @for (int i = 1; i <= ViewBag.PageCount; i++)
                            {
                                <a href="/Course/CourseStudents/?pageIndex=@i" class="btn btn-default">@i</a>
                            }

                            <a href="/Course/CourseStudents?PageIndex=@Convert.ToInt32((ViewBag.PageIndex + 1) >= ViewBag.PageCount ? (ViewBag.PageCount) : (ViewBag.PageIndex + 1))" class="btn btn-default">下一页</a>

                            <a href="/Course/CourseStudents?PageIndex=@ViewBag.PageCount" class="btn btn-primary btn-lg active">尾页</a>


                        </div>

                    </div>
                </div>

            </div>
            <!--课程图片-->
        </div>



    </div>

    @*模态：添加学员*@
    <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog ">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">添加学员</h4>
                </div>
                <form data-widget-cid="widget-0" novalidate="novalidate" id="student-create-form" class="form-horizontal" method="post" action="/Course/AddStudents">
                    <div class="modal-body">
                        <div class="row form-group">
                            <div class="col-md-2 control-label">
                                <label for="student-nickname">学员</label>
                            </div>
                            <div class="col-md-7 controls">
                                <input data-explain="只能添加系统中已注册的用户" data-widget-cid="widget-1" id="student-nickname" name="StuName" class="form-control" placeholder="邮箱/手机/用户名" type="text">
                                <div class="help-block">只能添加系统中已注册的用户</div>
                            </div>
                        </div>

                        <div class="row form-group">
                            <div class="col-md-2 control-label">
                                <label for="buy-price">购买价格</label>
                            </div>
                            <div class="col-md-7 controls">
                                <input data-explain="本课程的价格为0.00元" data-widget-cid="widget-3" id="buy-price" name="StudentPrice" value="0" class="form-control" type="text">
                                <div class="help-block">本课程的价格为0.00元</div>
                            </div>
                        </div>

                        <div class="row form-group">
                            <div class="col-md-2 control-label">
                                <label for="student-remark">备注</label>
                            </div>
                            <div class="col-md-7 controls">
                                <input data-explain="选填" data-widget-cid="widget-2" id="student-remark" name="StudentRemark" class="form-control" type="text">
                                <div class="help-block">选填</div>
                            </div>
                        </div>
                        <input name="StudentDateTime" type="hidden">

                        <input name="_csrf_token" value="befa272383a8de21ff594282bbe0b6d6f776f5d1" type="hidden">


                    </div>
                    <div class="modal-footer">
                        <button id="student-create-form-submit" type="submit" class="btn btn-primary pull-right" data-toggle="form-submit" data-target="#student-create-form" data-submiting-text="正在保存..." data-user="学员">保存</button>
                        <button type="button" class="btn btn-link pull-right" data-dismiss="modal">取消</button>
                        <script>app.load('course-manage/student-create')</script>
                    </div>
                </form>
            </div>
        </div>
    </div>

    @*模态：发送私信*@
    <div class="modal fade" id="modal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog ">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">发送私信</h4>
                </div>
                <div class="modal-body">
                    <form data-widget-cid="widget-3" novalidate="novalidate" id="message-create-form" class="form-horizontal" method="post" action="/message/create/34">

                        <div class="form-group">
                            <div class="col-md-2 control-label"><label for="message_receiver" class="required">收件人</label></div>
                            <div class="col-md-8 controls">
                                <input data-explain="" data-widget-cid="widget-4" id="message_receiver" name="message[receiver]" required="required" class="form-control" rows="1" data-url="/message/check/receiver" value="" type="text">
                                <div class="help-block" style="display:none;"></div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-2 control-label"><label for="message_content" class="required">内容</label></div>
                            <div class="col-md-8 controls">
                                <textarea data-explain="" data-widget-cid="widget-5" id="message_content" name="message[content]" required="required" class="form-control" rows="5"></textarea>
                                <div class="help-block" style="display:none;"></div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-offset-2 col-md-8 controls">
                                <input id="message__token" name="message[_token]" value="15bf9e0b76ae8f3f20d2b4b95e55e8bfa8846e3d" type="hidden">
                                <button class="btn btn-primary" type="submit">发送</button>
                            </div>
                        </div>

                        <input name="_csrf_token" value="3a5b67716c95aa51c4a6b183f110a100eed71c82" type="hidden">
                    </form>

                    <script> app.load('user/message-send-modal'); </script>
                </div>
            </div>
        </div>
    </div>

    @*模态：查看资料*@
    <div class="modal fade" id="modal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog ">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">个人详细信息</h4>
                </div>
                    <div class="modal-body">
                        <table class="table table-striped table-condenseda table-bordered">
                            <tbody>  
                                <tr>
                                    <th width="25%">用户名</th>
                                    <td width="75%">
                                        <a class="pull-right" href="/user/34" target="_blank">个人主页</a>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>Email</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>姓名</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>性别</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>公司</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>职业</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>头衔</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>电话</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>个人签名</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>自我介绍</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>个人网站</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>微博</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>微信</th>
                                    <td>
                                        暂无
                                    </td>
                                </tr>

                                <tr>
                                    <th>QQ</th>
                                    <td>
                                       暂无
                                    </td>
                                </tr>
                                }

                            </tbody>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
                    </div>
            </div>
        </div>
    </div>

    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.3';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };
        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';
        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.3" };
        app.arguments = {};
        app.controller = 'user/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';
        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.3';
    </script>
    <script src="/Content/js/sea.js?6.9.3"></script>
    <script src="/Content/js/seajs-style.js?6.9.3"></script>
    <script src="/Content/js/seajs-global-config.js?6.9.3"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    <div class="fixed-bar">
        <a href="/admin/feedback" target='_blank' class="icon-question-text feedback">
            <i class="es-icon es-icon-help"></i>
            <span>产品<br />反馈</span>
        </a>
    </div>
</body>

</html>